﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Areas/AdminPanel/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<Domain.Customer>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Customers
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <h2>Customers</h2>

    <table>
        <tr>
            
            <th>
                ID
            </th>
            <th>
                Display Name
            </th>
            <th>
                Legal Name
            </th>
            <th>
                Bank 
            </th>
            <th>
                AccountNumber
            </th>
            <th>
                Director
            </th>
            <th>
                TIN
            </th>
            <th>
                Legal Address
            </th>
            <th>
                Business Address
            </th>
            <th>
                Contact Name
            </th>
            <th>
                Contact Phone
            </th>
            <th>
                Date
            </th>
            <th>
                Is legal
            </th>
            <th></th>
        </tr>

    <% foreach (var item in Model) { %>
    
        <tr>
            
            <td>
                <%: item.CustomerId %>
            </td>
            <td>
                <%: item.DisplayName %>
            </td>
            <td>
                <%: item.LegalName %>
            </td>
            <td>
                <%: item.BankName %>
            </td>
            <td>
                <%: item.AccountNumber %>
            </td>
            <td>
                <%: item.DirectorName %>
            </td>
            <td>
                <%: item.TIN %>
            </td>
            <td>
                <%: item.LegalAddress %>
            </td>
            <td>
                <%: item.BusinessAddress %>
            </td>
            <td>
                <%: item.ContactName %>
            </td>
            <td>
                <%: item.ContactPhone %>
            </td>
            <td>
                <%: String.Format("{0:g}", item.CreateDate) %>
            </td>
            <td>
                <%: item.IsLegal %>
            </td>
            <td>
                <%: Html.ActionLink("Edit", "Edit", new {  id=item.CustomerId  })%> |
                <%: Html.ActionLink("Delete", "Delete", new { id=item.CustomerId })%>
            </td>
        </tr>
    
    <% } %>

    </table>

    <p>
        <%: Html.ActionLink("Create New", "Create") %>
    </p>

</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="head" runat="server">
</asp:Content>

